Skip to content

Slice 1 of #7938: client-only id-client facade and Android arm64 target - #13445

Open
dezren39 wants to merge 5 commits into
mainfrom
lane-any-n-21350-id-client-slice1
Open

dezren39 wants to merge 5 commits into
mainfrom
lane-any-n-21350-id-client-slice1

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Implements slice 1 of #7938 (child #13403): a client-only Rust facade for the native Android client v1, plus the Android arm64-v8a target path.

Scope (client-only)

New id-client crate facades client-safe leaves only: id-core, id-caps, id-config, id-store, id-events, id-groups, id-sync, id-directory. It never touches id-worlds (wasmtime/russh/serve/listener), id-web (axum), id-cli, id-native-shell, or id-hw-shell. The android_dependency_boundary test enforces that exclusion by name; no hosting, drive, recovery, provider, push, or presence surfaces.

Verification (exact commands, all green 2026-11-23)

  • cargo test -p id-client — 3 unit + boundary + session tests pass (host, ambient nix cargo 1.99.0)
  • cargo fmt --check -p id-client — clean
  • bash android/check-android.sh with ANDROID_NDK_HOME=/home/user/.local/share/android-sdk/ndk/27.0.12077973 — host tests green, then cargo check -p id-client --target aarch64-linux-android green (1m05s, exit 0)
  • cargo tree -p id-client — no wasmtime/axum/russh/id-worlds/id-web/id-cli/id-native-shell/id-hw-shell edges
  • Cargo.lock diff: +19 lines, new crate only

Disclosures

  • hyper appears in cargo tree -i hyper only transitively via reqwest in id-sync (and via iroh in id-core) — HTTP client usage, not the Axum server surface. No action; recorded here deliberately.
  • Toolchain: the gate scopes RUSTC to the Android leg only (rustup run 1.99.1 cargo + explicit RUSTC + TARGET_CC/_CXX/_AR at NDK API 21 + isolated target/android-check + sccache bypass). Exporting RUSTC for the host leg poisons proc-macro reuse (E0514); sharing target/ across toolchains does the same — both verified the hard way.
  • Pre-existing, untouched by this slice: 9 expect_used clippy errors in id-store/src/admission.rs under the 1.99.1 clippy driver (system clippy-driver is broken: missing librustc_driver .so). Slice adds no new clippy issues.

Closes #13403 (slice 1 of #7938).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T16:15:25Z",
    "session_id": "ses_e5df72672afffesSF3AUwzFSzy",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code",
      "repo": "developing-today/code",
      "branch": "lane-any-n-21350-id-client-slice1",
      "sha": "5ac76150d4525bc92b4b29cd697d44f96e26dabe"
    },
    "auth_subject": "oc-code-04",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…et (child #13403)

- New id-client crate: facade over client-safe leaves only
  (id-core, id-caps, id-config, id-store, id-events, id-groups,
  id-sync, id-directory); never id-worlds/id-web/id-cli/shells.
- Ed25519 challenge/response session + one-session acceptance probe.
- android_dependency_boundary gate enforces the exclusion set.
- pkgs/id/android/check-android.sh: host tests + aarch64-linux-android
  resolve (NDK clang via TARGET_CC/_CXX/_AR, API 21; isolated
  target dir and sccache bypass for the 1.99.1 toolchain leg).

Verified: cargo test -p id-client (3 unit + boundary + session green),
cargo fmt --check clean, cargo check --target aarch64-linux-android
green (NDK 27.0.12077973). hyper appears only transitively via
reqwest in id-sync (HTTP client, not the Axum server surface).
Pre-existing: 9 expect() clippy errors in id-store/src/admission.rs
under the 1.99.1 clippy driver, untouched by this slice.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

CodeRabbit ASCII loading animation

Currently processing new changes in this PR. This may take a few minutes, please wait...

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e8b1cf09-5c1f-4890-a2f6-6b781b643cf7
Commits

Reviewing files that changed from the base of the PR and between 74eee89 and ed4ad8f.

Files ignored due to path filters: 1

  • pkgs/id/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 8

  • pkgs/id/Cargo.toml
  • pkgs/id/android/README.md
  • pkgs/id/android/check-android.sh
  • pkgs/id/crates/id-client/Cargo.toml
  • pkgs/id/crates/id-client/src/lib.rs
  • pkgs/id/crates/id-client/src/session.rs
  • pkgs/id/crates/id-client/tests/android_dependency_boundary.rs
  • pkgs/id/crates/id-client/tests/authenticated_session.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T16:48:33.262401Z 471b2bd New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ac76150d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +22 to +23
set -euo pipefail
cd "$(dirname "$0")/.."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject unexpected arguments before running the Android gate

When invoked with --dry-run, --help, or a stray positional argument, this script silently ignores the argument and runs the host tests and Android checks, including filesystem writes. Declare that the gate accepts no arguments and reject unexpected input with a non-zero usage exit before the first subprocess. This violates the operator-script argument contract in root AGENTS.md.

AGENTS.md reference: AGENTS.md:L44-L48

Useful? React with 👍 / 👎.

Comment on lines +63 to +66
let manifest = manifest_deps();
for forbidden in FORBIDDEN {
assert!(
!names_crate(&manifest, forbidden),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check the resolved dependency closure rather than manifest text

The Android boundary gate only scans id-client/Cargo.toml, so it cannot detect forbidden dependencies introduced through any of the eight leaf crates or through target-specific transitive dependencies. For example, adding wasmtime to id-sync would leave this test green because the facade manifest remains unchanged. Since this test is advertised as enforcing the Android dependency closure, inspect the resolved Android graph and apply the exclusions to its reachable packages instead.

Useful? React with 👍 / 👎.

Comment on lines +20 to +22
pub mod session;

pub use session::{ClientIdentity, SessionError, TestWorld};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Expose the client-safe leaves through the facade

A consumer depending on id-client receives only the standalone challenge-signing demonstration: none of the eight client-safe crates listed in the module documentation is re-exported or used by a public wrapper. Declaring them as Cargo dependencies does not make their APIs available to downstream consumers, so the Kotlin shell cannot access the existing storage, sync, or directory functionality through this facade. Add the intended public re-exports or client wrappers so the new crate actually provides the client-core boundary it documents.

Useful? React with 👍 / 👎.

The slice commit swept a pre-staged doc/fleet-schedule-registry.md
change into PR #13445. That edit belongs to another worker's lane, not
slice 1 of #7938. Restore the file to main's content so the PR touches
only slice files.
@dezren39

Copy link
Copy Markdown
Member Author

Lane note (task 21350 follow-up): the slice commit accidentally swept a pre-staged doc/fleet-schedule-registry.md edit into this PR. Reverted in 471b2bd — the file now matches main byte-for-byte (git diff main -- doc/fleet-schedule-registry.md empty). The one-row timer text GitHub still shows vs the (older) merge-base is main's own landed content, not this slice. PR touches only slice-1 files.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 471b2bd45d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +135 to +138
fn test_bad_challenge_length_rejected() {
let client = ClientIdentity::generate();
let err = client.sign_challenge(&[0_u8; 7]).unwrap_err();
assert!(matches!(err, SessionError::BadChallenge));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add property tests for the session invariants

The new session API enforces challenge-length and signature-integrity invariants, but its tests exercise only individual examples: this rejection test checks just a seven-byte challenge, and there is no property coverage in id-client. Root AGENTS.md requires property tests for code with invariants; its linked testing doctrine explicitly includes ID/crypto formats. Add generated challenge lengths and contents, checking that signing succeeds exactly at 32 bytes, valid signatures verify, and altered challenges are rejected. The existing examples can remain as smoke tests.

AGENTS.md reference: AGENTS.md:L37-L39

Useful? React with 👍 / 👎.

# Conflicts:
#	doc/fleet-schedule-registry.md
…nt contract)

The Android gate takes no arguments. Any argument is a usage error
naming the offender (exit 2), checked before the first subprocess.
Fixes the Codex P1 on #13445.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android client slice 1: client-only Rust facade and arm64 build

1 participant